#ifndef FILESYSTEMACTION_H
#define FILESYSTEMACTION_H

#include <QObject>
#include <QFile>
#include <QFileInfo>

class FileSystemAction : public QObject
{
    Q_OBJECT
public:
    explicit FileSystemAction(QObject *parent = nullptr);
    ~FileSystemAction();

    void fileclose();
    int getPercent();

    Q_INVOKABLE void startCopy(QString source, QString target);
    Q_INVOKABLE void cancelCopy();

signals:
    void progress(quint64 totalbyte, quint64 writtenbyte, int percent);

public slots:
    bool processCopySingleFile();

private:
    QFile m_sourceFile;
    QFile m_targetFile;
    quint64 m_sourceSize;
    quint64 m_bytesWritten;
    bool m_cancelCurrentAction;
};

#endif // FILESYSTEMACTION_H
